package com.hys.ultrasound.business.activity;

import android.os.Bundle;
import android.text.TextUtils;

import androidx.navigation.NavController;
import androidx.navigation.Navigation;
import androidx.navigation.ui.NavigationUI;

import com.blankj.utilcode.util.LogUtils;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import com.hys.ultrasound.R;
import com.hys.ultrasound.base.ui.BaseActivity;

import butterknife.BindView;

/**
 * @desc:MainActivity
 * @date:2020/10/13 15:46
 * @auther:lp
 * @version:1.1.6
 */
public class MainActivity extends BaseActivity {

    @BindView(R.id.nav_view)
    BottomNavigationView mNavView;

    private NavController mNavController;

    @Override
    protected void initView() {
//      AppBarConfiguration  appBarConfiguration = new AppBarConfiguration.Builder(
//                R.id.tab_home, R.id.tab_scan, R.id.tab_report, R.id.tab_user_center)
//                .build();
//        //设置切换tab时候title内容
//        NavigationUI.setupActionBarWithNavController(this, navController, appBarConfiguration);

        mNavController = Navigation.findNavController(this, R.id.nav_host_fragment);
        NavigationUI.setupWithNavController(mNavView, mNavController);

        //获取参数，更具参数做不同操作
        String patient = getIntent().getStringExtra("QTParams");
        if (!TextUtils.isEmpty(patient)) {
            mNavView.setSelectedItemId(R.id.tab_scan);
            Bundle bundle = new Bundle();
            bundle.putString("QTParams", patient);
            mNavController.navigate(R.id.tab_scan, bundle);
            LogUtils.d(patient);
        }
    }

    @Override
    protected void initData() {

    }

    @Override
    protected int getLayoutResId() {
        return R.layout.activity_main;
    }

}